package com.link2room.optimus.controller.inside;


import com.link2room.common.dto.result.base.BaseResultDto;
import com.link2room.optimus.dto.param.base.TaobaoXrateplanBaseParamDto;
import com.link2room.optimus.dto.result.base.TaobaoXrateplanDto;
import com.link2room.optimus.facade.ITaobaoXrateplanFacadeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * Created by VegetaKo on 2017/1/12.
 */
@Api(tags = "淘宝价格计划管理")
@RestController
@RequestMapping("/in/TaobaoXrateplans")
public class TaobaoXrateplanInsideController {

    @Resource
    private ITaobaoXrateplanFacadeService taobaoXrateplanFacadeService;


    @RequestMapping(value = "/TaobaoXrateplan",method = RequestMethod.GET)
    public BaseResultDto taobaoXrateplan(
            @RequestParam(value = "rpCode" ,required = false) String rpCode
    ) throws Exception {
        TaobaoXrateplanBaseParamDto taobaoXrateplanBaseParamDto =new TaobaoXrateplanBaseParamDto();
        taobaoXrateplanBaseParamDto.setRpCode(rpCode);
        TaobaoXrateplanDto taobaoXrateplanDto = taobaoXrateplanFacadeService.findTaobaoXrateplanByRpcode(taobaoXrateplanBaseParamDto);
        BaseResultDto<TaobaoXrateplanDto> baseResultDto=new BaseResultDto<>();
        baseResultDto.setResultCode(0);
        baseResultDto.setResultInfo(taobaoXrateplanDto);
        return baseResultDto;
    }

}
